<?php
$studentId = $_GET['userid'];
$type = $_GET['type'];
if($studentId == null || $type == null){
    echo json_encode(array('status'=>401,'msg'=>'参数错误'),JSON_UNESCAPED_UNICODE);
    die;
}
require('../../../cofd/common.php');
$mysqli = $conn;
$allssw = 'all';
$query = "SELECT * FROM exam_msg WHERE (fors = ? AND tos = ?) OR (fors = ? AND tos = ?) OR (fors = ? AND tos = ?)";
$stmt = $mysqli->prepare($query);
$stmt->bind_param("ssssss", $studentId, $type, $allssw, $type, $allssw, $allssw);
$stmt->execute();
$result = $stmt->get_result();
$teachersData = array();
while ($row = $result->fetch_assoc()) {
    $teachersData[] = $row;
}
$stmt->close();
$mysqli->close();
echo json_encode(array('status'=>200,'msg' => $teachersData));
?>